import jwt from 'jsonwebtoken';
import API from '../config/API';

export async function auth(account, password){
    const token = jwt.sign({ account, password }, API.SECRECT_KEY);
    return token;
}

export async function authBySMS(mobile, sms){

}


export async function authCheck(token){
    var decoded = jwt.verify(token, API.SECRECT_KEY);
    return decoded;
}